package chapter04.chapetr04.Example03;
class Animal{
    //定义动物叫的方法
    void shout(){
        System.out.println("动物发出叫声");
    }
}
//定义Dog类继承Animal类
class Dog extends Animal{
    //
    void shout(){
        System.out.println("汪汪汪....");
    }
}
// 定义测试
public class Example03 {
    public static void main(String[]ares){
        Dog dog = new Dog();
        dog.shout();
    }
}
